Repository navigation
feat(db): RLS on the communication batch (RLS unit 7) - #348
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the first business-table batch of
tenant-isolation-rlsunit 7.0027_communication_rls.sqlenables RLS and creates thetenant_isolationpolicy onmessage_log,whatsapp_templatesandpush_subscriptions. A test asserts that the file's statements are exactly the onesrls.tsgenerates for those tables. The drift baseline is regenerated to include 0027.Readiness: a mapping pass found every runtime access to these tables inside
withTenantTransaction, except the Meta WhatsApp webhook. WhatsApp is not in use; the migration header documents that the webhook now fails under the policy instead of reaching another tenant's row.Rehearsal (Neon branch copied from production, connected as
vyloop_app)200for all 6 tenants. Each tenant's history total matches the count the owner role sees.200, and each customer sees exactly their own subscriptions.db:rls --expect communicationanddb:driftpass.Verification
scriptscheck-rls + drift tests: 126/126.packages/db: 321/322. The one failure is environmental: it checks that the worktree directory name ends invyloop.Production apply: 0027 goes to production before this PR merges. An applied migration that is not yet on
maindoes not block the drift gate.Risk: item 1 (which rows production queries see) and item 2 (tenant isolation).
🤖 Generated with Claude Code